home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17269 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: Sun, 14 Apr 96 16:33:48 GMT
  6. Organization: none
  7. Message-ID: <829499628snz@genesis.demon.co.uk>
  8. References: <JSA.96Feb16135027@organon.com> <dewar.829345962@schonberg> <4knqun$ga1@nntp.Stanford.EDU> <dewar.829399701@schonberg> <4kpceq$e4b@solutions.solon.com> <dewar.829446681@schonberg>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <dewar.829446681@schonberg> dewar@cs.nyu.edu "Robert Dewar" writes:
  15.  
  16. >Peter said:
  17. >
  18. >"delete() is not ANSI.  remove() is ANSI.  I have never seen a system that
  19. >didn't offer it, since the 3b1.  It's certainly trivial to write.  (A good
  20. >patch for portability is to write standard code, and have a set of
  21. >conditionally built modules to provide the standard functions in terms
  22. >of the not-standard but available on all old systems functions.)"
  23. >
  24. >Oops, that's right, it is indeed remove I meant (I don't know it because
  25. >I don't use it -- I don't use it because the Microsoft book says it is
  26. >not implemented in some systems). On the other hand, that same book says
  27. >that unlink is implemented in all systems, so clearly at least for the 
  28. >moment unlink is safer to use if you are aiming at maximum portability.
  29.  
  30. remove() is the ANSI defined function, unlink() is the Unix/POSIX defined
  31. function. I guess comp.lang.ada readers would be more interested in the
  32. latter as far as this thread is concerned but comp.lang.c readers should
  33. be using remove() unless they have a good reason not to. I believe the book
  34. is misleading you.
  35.  
  36. I wonder though if Ada provides all of the functionality that the C standard
  37. library provides and if not whether the Ada POSIX bindings redress the
  38. holes.
  39.  
  40. >Rememerb that gcc is targeted to more than 300 different C library
  41. >environments, and you want to absolutely minimize conditional stuff.
  42.  
  43. gcc has been ported to environments over many years which have little or
  44. no ANSI C support. The situation now is somewhat different, not least
  45. because you can use gcc/glibc on many systems. By the sound of it
  46. GNAT is doing a similar service for up-to-date Ada. The considerations are
  47. different for code written now.
  48.  
  49. >That's what I meant by having a strenuous view of portability. I would
  50. >rather guess that Peter is pretty Unix oriented, and of course we are
  51. >trying for a wider scope of portability than Unix!
  52.  
  53. In which case you definitely want the ANSI C remove() over the Unix/POSIX
  54. unlink(). The only systems where unlink() is more likely to occur are
  55. very old systems since unlink() existed first.
  56.  
  57. -- 
  58. -----------------------------------------
  59. Lawrence Kirby | fred@genesis.demon.co.uk
  60. Wilts, England | 70734.126@compuserve.com
  61. -----------------------------------------
  62.